'''
yjs
'''
def anagrams(word, exms):
    result = []
    for value in exms:
        if len(value) > len(word):
            continue
        word_list = list(word)
        for v in value:
            if v in word:
                word_list.remove(v)
        if not word_list:
            result.append(value)
    return result
print(anagrams('sccd', ['dsca', 'scd']))